/**
 * 作者: wgx
 * 日期: 2024-11-26 16:55:57
 * 备注: 商店
 */
package com.motu.monstercity.server.game.commondata.shop;

import io.vertx.core.json.JsonObject;

public class ShopModel {
    protected int id; // id
    protected int shopType; // 商店类型
    protected int subShopType; // 商店子类型 (同类形商店，不同期的配置区分)
    protected String reward; // 获得的物品id (itemid;num;itemid;num)
    protected String price; // 价格,消耗的道具 (itemid;num;itemid;num)
    protected int limitType; // 限购类型 (0-不限购,1-每日限购,2-每周限购,3-每月限购,4-终身限购)
    protected int limitNum; // 限购数量
    protected int moduleId; // 对应的模块id,解锁了才能购买 (0-表示不需要解锁具体模块)
    protected int unlockType; // 解锁条件 (0-无限制,1-市政等级,2-关卡进度,3,vip等级)
    protected int unlockValue; // 解锁条件的值
    protected int isFree; // 是否免费 (1-免费)
    protected int priceAdd; // 购买次数累计的价格

    public ShopModel() {
    }

    public ShopModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        shopType = obj.containsKey("shop_type") ? obj.getInteger("shop_type") : 0;
        subShopType = obj.containsKey("sub_shop_type") ? obj.getInteger("sub_shop_type") : 0;
        reward = obj.containsKey("reward") ? obj.getString("reward") : "";
        price = obj.containsKey("price") ? obj.getString("price") : "";
        limitType = obj.containsKey("limit_type") ? obj.getInteger("limit_type") : 0;
        limitNum = obj.containsKey("limit_num") ? obj.getInteger("limit_num") : 0;
        moduleId = obj.containsKey("module_id") ? obj.getInteger("module_id") : 0;
        unlockType = obj.containsKey("unlock_type") ? obj.getInteger("unlock_type") : 0;
        unlockValue = obj.containsKey("unlock_value") ? obj.getInteger("unlock_value") : 0;
        isFree = obj.containsKey("is_free") ? obj.getInteger("is_free") : 0;
        priceAdd = obj.containsKey("price_add") ? obj.getInteger("price_add") : 0;
    }

    public int getId() {
        return id;
    }

    public int getShopType() {
        return shopType;
    }

    public int getSubShopType() {
        return subShopType;
    }

    public String getReward() {
        return reward;
    }

    public String getPrice() {
        return price;
    }

    public int getLimitType() {
        return limitType;
    }

    public int getLimitNum() {
        return limitNum;
    }

    public int getModuleId() {
        return moduleId;
    }

    public int getUnlockType() {
        return unlockType;
    }

    public int getUnlockValue() {
        return unlockValue;
    }

    public int getIsFree() {
        return isFree;
    }

    public int getPriceAdd() {
        return priceAdd;
    }

}
